import request from "@/utils/request";

export function reqUserInfo(data) {
    return request({
        url: "/userInfo",
        method: "post",
        data,
    });
}

export function getUsers() {
    return request({
        url: "/user",
        method: "get",
    });
}

export function deleteUser(data) {
    // console.log(data)
    return request({
        url: `/user/${data.userId}`,
        method: "delete",
        
    });
}

export function editUser(data) {
    return request({
        url: "/user",
        method: "post",
        headers:{
            'update':true
        },
        data,
    });
}

export function reqValidatUserID(data) {
    return request({
        url: "/user/validatUserID",
        method: "post",
        data,
    });
}

export function addUser(data) {
    return request({
        url: "/user",
        method: "post",
        headers:{
            'update':false
        },
        data,
    });
}
